"""
Project Name : api_automation_framework
File Name : brotli_demo.py
Author : lldhsds
Date : 2024/12/27 22:50
Description: /brotli接口，返回一个 Brotli 压缩格式的响应。Brotli 是一种现代的无损数据压缩算法，主要用于 HTTP 响应的压缩。
"""
import requests

# GET: /brotli
# Returns Brotli-encoded data.
# parameters: None
# response: 200(Brotli-encoded data.)
def brotli_demo():
    response_format = 'brotli'
    url = f"http://httpbin.org/{response_format}"
    headers = {'accept': 'application/json'}
    response = requests.get(url, headers=headers)
    print(response.status_code)
    print(response.json())
    print(response.text)
    print(response.content)
    print(response.headers)
    print(response.headers['Content-Encoding'])

brotli_demo()
